//
//  StarView.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/8/5.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class StarView: UIView {
    
    
    var starCount : Int = -1{
    
        didSet{
            
            switch starCount {
             case 1:
                star1.isHidden = false
                star2.isHidden = true
                star3.isHidden = true
                star4.isHidden = true
                star5.isHidden = true
                case 2:
                    star1.isHidden = false
                    star2.isHidden = false
                    star3.isHidden = true
                    star4.isHidden = true
                    star5.isHidden = true
                case 3:
                    star1.isHidden = false
                    star2.isHidden = false
                    star3.isHidden = false
                    star4.isHidden = true
                    star5.isHidden = true
                case 4:
                    star1.isHidden = false
                    star2.isHidden = false
                    star3.isHidden = false
                    star4.isHidden = false
                    star5.isHidden = true
                case 5:
                    star1.isHidden = false
                    star2.isHidden = false
                    star3.isHidden = false
                    star4.isHidden = false
                    star5.isHidden = false
            default:
                star1.isHidden = true
                star2.isHidden = true
                star3.isHidden = true
                star4.isHidden = true
                star5.isHidden = true
            }
        
        
        
        }
    
    }
    
    
    @IBOutlet weak var star1: UIImageView!

    @IBOutlet weak var star2: UIImageView!
    
    
    @IBOutlet weak var star3: UIImageView!
    
    
    @IBOutlet weak var star4: UIImageView!
    
    @IBOutlet weak var star5: UIImageView!
    
    
    
    override func awakeFromNib() {
        
        super.awakeFromNib()
        
        
        
        
    }
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
